﻿namespace Sinc.ERP.Core.SeedData;

/// <summary>
/// 系统机构表种子数据
/// </summary>
[IgnoreUpdateSeed]
public class SysOrgSeedData : ISqlSugarEntitySeedData<SysOrg>
{
    public const long DefaultOrgId = 1300000001001;
    public const long CustomerOrgId = 1300000001002;
    /// <summary>
    /// 种子数据
    /// </summary>
    /// <returns></returns>
    public IEnumerable<SysOrg> HasData()
    {
        var admin = new SysUserSeedData().HasData().First(u => u.Account == "admin");
        return new[]
        {
            new SysOrg{ Id = DefaultOrgId, Pid = SqlSugarConst.DefaultTenantId, Name="电商部", Code="100201", Level=2, CreateTime=DateTime.Now, CreateUserId = admin.Id, TenantId=SqlSugarConst.DefaultTenantId },
            new SysOrg{ Id = CustomerOrgId, Pid = SqlSugarConst.DefaultTenantId, Name="客户", Code="100202", Level=2, CreateTime=DateTime.Now, CreateUserId = admin.Id, TenantId=SqlSugarConst.DefaultTenantId },
        };
    }
}